package com.iss.okair.db.mapper;

import com.iss.okair.db.entity.AssetsFinance;
import com.iss.okair.db.entity.AssetsTranUse;
import com.iss.okair.db.entity.Assetstrans;
import com.iss.okair.db.mapper.transsql.FinalTransSQL;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;

public interface FinalTransMapper {
    @SelectProvider(type = FinalTransSQL.class, method="select")
     List<AssetsTranUse> select (AssetsTranUse model);
    @Insert("INSERT INTO assetstrans VALUES(#{id},#{assetsid},#{batchno},#{transtype},#{count},#{price},#{handleremp},#{instocktime},#{targetemp},#{comment},NOW(),#{createuser})")
    int instock(Assetstrans trans);
    @Select("select assetsCode FROM assets_finance where id=#{id}")
    AssetsFinance instocks(@Param("id") String id);
    @Select("SELECT *FROM alltranslist WHERE assetsid=#{assetsid}")
    List<AssetsTranUse> Record(String assetsid);

}
